<html>
<head><meta charset="utf-8"><title>ICEs · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html">ICEs</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="214807789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214807789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214807789">(Oct 28 2020 at 08:42)</a>:</h4>
<p>Hi,<br>
as you saw, Matthias reported several ICEs. Never dealt with that before, I was wondering how are you testing this on Clippy basecode?<br>
Do we need to just add a test file in <code>ui/crashes/ice-xxxx.rs</code> and run <code>cargo test</code>? Or do we need to declare something else more specific?<br>
I ask this because for example for <a href="https://github.com/rust-lang/rust-clippy/issues/6251">https://github.com/rust-lang/rust-clippy/issues/6251</a>, I added a test file and I saw the same error Matthias encountered, then I read the message of Eduardo so I got confused.<br>
I don't say you are wrong, maybe my test is totally broken <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> , but then I was wondering what is the process for ICEs <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="214813791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214813791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eduardo Broto <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214813791">(Oct 28 2020 at 09:51)</a>:</h4>
<p>Oh I could be totally wrong xD</p>
<p>So on my side I tested it in the playground which has a fairly recent copy of Clippy (yesteday). Some of them I tested them manually, adding a file and running the driver against it, but the procedure you mention (adding to crashes and <code>cargo test</code>) should work too.</p>
<p>When testing locally, make sure to update the toolchain as those ICEs seem to have been fixed in rustc fairly recently.</p>



<a name="214813930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214813930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eduardo Broto <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214813930">(Oct 28 2020 at 09:52)</a>:</h4>
<p>The one you mention does not seem to crash in rustc nightly / current Clippy. The compile errors are expected though, but the ICE does not seem to be present.</p>



<a name="214814390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214814390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214814390">(Oct 28 2020 at 09:57)</a>:</h4>
<p>Thanks! Didn't update the toolchain, that might be the reason <span aria-label="wink" class="emoji emoji-1f609" role="img" title="wink">:wink:</span></p>



<a name="214815591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214815591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eduardo Broto <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214815591">(Oct 28 2020 at 10:08)</a>:</h4>
<p>BTW <span class="user-mention" data-user-id="217864">@matthiaskrgr</span> I did not close the issues as I wanted you to have the chance to take a second look in case I messed up <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>
<p>Feel free to close them or ping me if you think they're still relevant</p>



<a name="214832288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214832288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214832288">(Oct 28 2020 at 13:02)</a>:</h4>
<p>ah dang, my nighty is only 3 days behind, I didn't think it would make much of a difference <span aria-label="sad" class="emoji emoji-2639" role="img" title="sad">:sad:</span></p>



<a name="214832430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214832430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214832430">(Oct 28 2020 at 13:03)</a>:</h4>
<p>I have a small program that runs <code>clippy-driver file.rs</code> and greps the output for a few suspicious ICE keywords</p>



<a name="214832527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214832527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214832527">(Oct 28 2020 at 13:04)</a>:</h4>
<p>I should make it use the master rust instead of <code>${default_toolchain}</code> ... :/</p>



<a name="214836304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214836304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214836304">(Oct 28 2020 at 13:35)</a>:</h4>
<p>I'll see if I can add the tickets as testcases at least ...</p>



<a name="214836399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214836399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214836399">(Oct 28 2020 at 13:36)</a>:</h4>
<p>ah, looks like we need a sync because of the uplifted CString lint</p>



<a name="214837068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214837068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214837068">(Oct 28 2020 at 13:41)</a>:</h4>
<p>Rustup PR has been open, but seems incomplete: <a href="https://github.com/rust-lang/rust-clippy/pull/6257">https://github.com/rust-lang/rust-clippy/pull/6257</a></p>



<a name="214838012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214838012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214838012">(Oct 28 2020 at 13:48)</a>:</h4>
<p>is it dogfood that fails? I get that locally</p>



<a name="214838101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214838101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214838101">(Oct 28 2020 at 13:49)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust-clippy/pull/6257/checks?check_run_id=1318960349#step:15:24">https://github.com/rust-lang/rust-clippy/pull/6257/checks?check_run_id=1318960349#step:15:24</a>   wtf :D</p>



<a name="214839718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214839718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214839718">(Oct 28 2020 at 14:00)</a>:</h4>
<p>I don't get the meaning of this error xD</p>



<a name="214841396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214841396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214841396">(Oct 28 2020 at 14:10)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust-clippy/blob/master/.github/driver.sh#L25">https://github.com/rust-lang/rust-clippy/blob/master/.github/driver.sh#L25</a><br>
this is the failing test</p>



<a name="214842074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214842074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214842074">(Oct 28 2020 at 14:16)</a>:</h4>
<p>I guess it's because this changed here: <a href="https://github.com/rust-lang/rust-clippy/pull/6257/commits/a1bb10e9b805d3bd60d7c47dc453c011478245df#diff-8ecf57b9a08f582ba86e6907c7c98a902a80cfa68b8f6ba59dca3fa160465e82R25">https://github.com/rust-lang/rust-clippy/pull/6257/commits/a1bb10e9b805d3bd60d7c47dc453c011478245df#diff-8ecf57b9a08f582ba86e6907c7c98a902a80cfa68b8f6ba59dca3fa160465e82R25</a>.<br>
But it shouldn't fail, it is comparing with the right <code>stderr</code> file. Or maybe the <code>sed</code> command is not doing the right job anymore <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="214842504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214842504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214842504">(Oct 28 2020 at 14:19)</a>:</h4>
<p>yeah I also though that the testcase itself should not matter but apparently it does <span aria-label="smiley" class="emoji emoji-1f603" role="img" title="smiley">:smiley:</span></p>



<a name="214843153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214843153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214843153">(Oct 28 2020 at 14:24)</a>:</h4>
<p>ok there is something different in the format...</p>



<a name="214843162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214843162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214843162">(Oct 28 2020 at 14:24)</a>:</h4>
<p>I think</p>



<a name="214843202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214843202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214843202">(Oct 28 2020 at 14:24)</a>:</h4>
<p>so it's probably the sed regex that needs to be updated..?</p>



<a name="214843434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214843434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214843434">(Oct 28 2020 at 14:26)</a>:</h4>
<p>the cstring messages looked like this:</p>
<div class="codehilite"><pre><span></span><code>error: you are getting the inner pointer of a temporary `CString`
  --&gt; $DIR/cstring.rs:9:5
   |
LL |     CString::new(&quot;foo&quot;).expect(&quot;dummy&quot;).as_ptr();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: that pointer will be invalid outside this expression
help: assign the `CString` to a variable to extend its lifetime
  --&gt; $DIR/cstring.rs:9:5
   |
LL |     CString::new(&quot;foo&quot;).expect(&quot;dummy&quot;).as_ptr();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
</code></pre></div>


<p>while the cast messages look like this:</p>
<div class="codehilite"><pre><span></span><code>error: casting `i64` to `f32` causes a loss of precision (`i64` is 64 bits wide, but `f32`&#39;s mantissa is only 23 bits wide)
  --&gt; tests/ui/cast.rs:13:5
   |
LL |     x1 as f32;
   |     ^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
</code></pre></div>



<a name="214843560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214843560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214843560">(Oct 28 2020 at 14:27)</a>:</h4>
<p>note how the cast has</p>
<div class="codehilite"><pre><span></span><code>|
= help:
</code></pre></div>


<p>and cstring has</p>
<div class="codehilite"><pre><span></span><code>|
= note:
help:
</code></pre></div>



<a name="214843755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214843755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214843755">(Oct 28 2020 at 14:28)</a>:</h4>
<p>so the remove <code> = help :</code> regex does not match</p>



<a name="214843802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214843802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214843802">(Oct 28 2020 at 14:28)</a>:</h4>
<p>altough you probably need to remove <code>help</code> and <code>note</code> now</p>



<a name="214843898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214843898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214843898">(Oct 28 2020 at 14:29)</a>:</h4>
<p><code>sed -e "s,tests/ui,\$DIR," -e "/= note/d"  -e  "/help/d" cast.stderr &gt; normalized.stderr</code></p>



<a name="214843915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214843915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214843915">(Oct 28 2020 at 14:29)</a>:</h4>
<p>maybe that fixes it</p>



<a name="214843941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214843941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214843941">(Oct 28 2020 at 14:29)</a>:</h4>
<p>(have not tried yet)</p>



<a name="214844165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/ICEs/near/214844165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/ICEs.html#214844165">(Oct 28 2020 at 14:31)</a>:</h4>
<p>err, it should probably be <code>/help: /d</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>